package com.yf.tz.dao;

import com.yf.tz.entity.AccountEntity;
import org.apache.ibatis.annotations.Mapper;
import com.yf.dao.BaseDao;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 账户信息Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Jul 01 16:32:18 CST 2020
 */
@Mapper
public interface AccountDao extends BaseDao<AccountEntity> {

    /**

        List<AccountVo> queryListVo(AccountVo accountVo);

        AccountVo getVo(Long id);

    **/

   AccountEntity findByUserIdAndType(@Param("userId") Long userId, @Param("type") Integer type);

   void decrease(@Param("userId") Long userId, @Param("type") Integer type, @Param("amount") BigDecimal amount);

   void increase(@Param("userId") Long userId, @Param("type") Integer type, @Param("amount") BigDecimal amount);

    List<AccountEntity> findByUserId(Long userId);

}
